﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IdentityServer4Blazor.Model;
using IdentityServer4Blazor.Shared.Dto.BaseDto;
using IdentityServer4Blazor.Shared.Dto.User;

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Repository;
using Services;

namespace IdentityServer4Blazor.Server.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        private readonly UserManager<User> _userManager;
        private readonly IUserServices _userServices;

        public UserController(UserManager<User> userManager,IUserServices userServices)
        {
            _userManager = userManager;
            _userServices = userServices;
        }


        [HttpGet]
        public async Task<PageRequestOutput<UserListOutput>> GetUserList([FromQuery]PageRequestInput input)
        {
            return await _userServices.GetUserList(input);
        }
        //[HttpGet]
        //public async Task<PageRequestOutput<UserListOutput>> GetUserClaims([FromQuery] int id)
        //{
        //    return await _userServices.GetUserClaims(id);
        //}
    }
}
